// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application.Service.InventoryQuery.Dto;

/// <summary>
/// 库存查询分页输入
/// </summary>
public class PageInventoryQueryInput : BasePageInput
{
    /// <summary>
    /// 关键词
    /// </summary>
    public string? Keyword { get; set; }

    /// <summary>
    /// 货品名称
    /// </summary>
    public string? GoodsName { get; set; }

    /// <summary>
    /// 货品类型
    /// </summary>
    public string? GoodsType { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 条码
    /// </summary>
    public string? Barcode { get; set; }

    /// <summary>
    /// 是否显示停用商品
    /// </summary>
    public bool ShowDisabled { get; set; } = false;

    /// <summary>
    /// 是否过滤零库存商品
    /// </summary>
    public bool FilterZero { get; set; } = false;
}

/// <summary>
/// 库存查询输出
/// </summary>
public class InventoryQueryOutput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 货品编号
    /// </summary>
    public string? GoodsCode { get; set; }

    /// <summary>
    /// 货品名称
    /// </summary>
    public string? GoodsName { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public string? Status { get; set; }

    /// <summary>
    /// 货品类型
    /// </summary>
    public string? GoodsType { get; set; }

    /// <summary>
    /// 规格型号
    /// </summary>
    public string? Specs { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    public string? Unit { get; set; }

    /// <summary>
    /// 条码
    /// </summary>
    public string? Barcode { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 库位名称
    /// </summary>
    public string? LocationName { get; set; }

    /// <summary>
    /// 当前库存
    /// </summary>
    public int CurrentStock { get; set; }

    /// <summary>
    /// 库存金额
    /// </summary>
    public decimal StockAmount { get; set; }

    /// <summary>
    /// 待入库
    /// </summary>
    public int PendingInbound { get; set; }

    /// <summary>
    /// 待出库
    /// </summary>
    public int PendingOutbound { get; set; }

    /// <summary>
    /// 可用库存
    /// </summary>
    public int AvailableStock { get; set; }

    /// <summary>
    /// 可用库存金额
    /// </summary>
    public decimal AvailableStockAmount { get; set; }

    /// <summary>
    /// 期初库存
    /// </summary>
    public int BeginningStock { get; set; }

    /// <summary>
    /// 期末库存
    /// </summary>
    public int EndingStock { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdateTime { get; set; }
}

/// <summary>
/// 获取库存统计输入
/// </summary>
public class GetInventoryStatsInput
{
    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 日期范围
    /// </summary>
    public DateTime[]? DateRange { get; set; }
}

/// <summary>
/// 库存统计输出
/// </summary>
public class InventoryStatsOutput
{
    /// <summary>
    /// 当前库存数量
    /// </summary>
    public int CurrentQuantity { get; set; }

    /// <summary>
    /// 当前库存金额
    /// </summary>
    public decimal CurrentAmount { get; set; }

    /// <summary>
    /// 入库数量
    /// </summary>
    public int InboundQuantity { get; set; }

    /// <summary>
    /// 出库数量
    /// </summary>
    public int OutboundQuantity { get; set; }

    /// <summary>
    /// 待入库
    /// </summary>
    public int PendingInbound { get; set; }

    /// <summary>
    /// 待出库
    /// </summary>
    public int PendingOutbound { get; set; }
}

/// <summary>
/// 获取出入库流水输入
/// </summary>
public class GetStockFlowInput : BasePageInput
{
    /// <summary>
    /// 出入库单号
    /// </summary>
    public string? DocumentCode { get; set; }

    /// <summary>
    /// 货品编号
    /// </summary>
    public string? GoodsCode { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 业务类型
    /// </summary>
    public string? BusinessType { get; set; }

    /// <summary>
    /// 出入库类型
    /// </summary>
    public string? FlowType { get; set; }

    /// <summary>
    /// 出入库日期
    /// </summary>
    public DateTime? OperationDate { get; set; }

    /// <summary>
    /// 制单日期
    /// </summary>
    public DateTime? CreateDate { get; set; }

    /// <summary>
    /// 日期范围
    /// </summary>
    public DateTime[]? DateRange { get; set; }
}

/// <summary>
/// 出入库流水输出
/// </summary>
public class StockFlowOutput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 出入库单号
    /// </summary>
    public string? DocumentCode { get; set; }

    /// <summary>
    /// 业务类型
    /// </summary>
    public string? BusinessType { get; set; }

    /// <summary>
    /// 出入库类型
    /// </summary>
    public string? FlowType { get; set; }

    /// <summary>
    /// 货品编号
    /// </summary>
    public string? GoodsCode { get; set; }

    /// <summary>
    /// 货品名称
    /// </summary>
    public string? GoodsName { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 库位名称
    /// </summary>
    public string? LocationName { get; set; }

    /// <summary>
    /// 入库数量
    /// </summary>
    public int InboundQuantity { get; set; }

    /// <summary>
    /// 出库数量
    /// </summary>
    public int OutboundQuantity { get; set; }

    /// <summary>
    /// 入库金额
    /// </summary>
    public decimal InboundAmount { get; set; }

    /// <summary>
    /// 出库金额
    /// </summary>
    public decimal OutboundAmount { get; set; }

    /// <summary>
    /// 出入库日期
    /// </summary>
    public string? OperationDate { get; set; }

    /// <summary>
    /// 经办人
    /// </summary>
    public string? Operator { get; set; }

    /// <summary>
    /// 制单人
    /// </summary>
    public string? Creator { get; set; }

    /// <summary>
    /// 所在部门
    /// </summary>
    public string? Department { get; set; }

    /// <summary>
    /// 制单时间
    /// </summary>
    public string? CreateTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
}

/// <summary>
/// 获取库存分布输入
/// </summary>
public class GetStockDistributionInput : BasePageInput
{
    /// <summary>
    /// 货品编号
    /// </summary>
    public string? GoodsCode { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }
}

/// <summary>
/// 库存分布输出
/// </summary>
public class StockDistributionOutput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 货品编号
    /// </summary>
    public string? GoodsCode { get; set; }

    /// <summary>
    /// 货品名称
    /// </summary>
    public string? GoodsName { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 库位名称
    /// </summary>
    public string? LocationName { get; set; }

    /// <summary>
    /// 库存数量
    /// </summary>
    public int StockQuantity { get; set; }

    /// <summary>
    /// 库存金额
    /// </summary>
    public decimal StockAmount { get; set; }

    /// <summary>
    /// 可用数量
    /// </summary>
    public int AvailableQuantity { get; set; }

    /// <summary>
    /// 锁定数量
    /// </summary>
    public int LockedQuantity { get; set; }
}
